//
// Created by Nasa on 2023/9/16.
// 按,分割string到数组中
//


#include <iostream>
#include <vector>
using namespace std;

int main()
{
    vector<string> l;
    string aa="abc,123,789,nasa,888888888888,abcd";
    int j=0;
    string b;
    for (int i = 0; i < aa.size(); ++i)
    {

        if (aa[i]==',' || i==aa.size()-1)
        {
            if(i==aa.size()-1)
            {
                b+=aa[i];
            }
            l.push_back(b);
            b="";
            j++;
        }else
        {
            b+=aa[i];
        }
    }
    for (int i = 0; i < l.size(); ++i)
    {
        cout<<l[i]<<' ';
    }
    return 0;
}